package org.ch02.test00.demo09.myWork;

import org.ch02.entity.Staffs;

import java.util.Date;

/**
 *
 * 十、设计一个方法，基于某个对象自动生成添加数据的 SQL 语句，并把该对象的数据插入到数据库中
 *     public class DbUtil{
 *
 *         public static int insert(User user){
 *             // 功能实现...
 *         }
 *
 *     }
 * @author CSY
 * @date 2025 - 03 - 19
 */
public class MainTest {
    public static void main(String[] args) throws Exception {
        Class<Staffs> clazz = Staffs.class;
        Staffs staffs = clazz.getConstructor(int.class,String.class,int.class,String.class,String.class,Date.class, Date.class)
                .newInstance(1001,"张三",18,"1231151","教师",new Date(),new Date());
        DbUtil.insert(staffs);
    }
}
